<?php
class Application_Form_Addhousing extends Zend_Form
{

    public function init()
    {
        // указываем имя формы
	$this->setName('profileForm');
        
        $this->setAction('/housing/validateformAction')
             ->setMethod('post');

        $givenName = $this->createElement('text', 'givenName');
        $givenName->setLabel('Given Name')
                  ->setRequired(true)
                  ->addFilter('stringTrim')
                  ->addValidator('stringLength', false, array(1,50))
                  ->setDecorators(array('Fieldset'));
              
        $familyName = $this->createElement('text', 'familyName');
        $familyName->setLabel('Family Name')
                   ->setRequired(true)
                   ->addFilter('stringTrim')
                   ->addValidator('stringLength', false, array(1,50));
                       /*
        $email = $this->createElement('text', 'email');
        $email->setLabel('E-Mail')
              ->setRequired(true)
              ->addFilter('stringTrim')
              ->addValidator('emailAddress', false);
        $url = $this->createElement('text', 'url');
        $url->setLabel('URL')
            ->setRequired(false)
            ->addFilter('stringTrim')
            ->addValidator('stringLength', false, array(1,100));
                   * 
                   */
        $submit = $this->createElement('submit', 'submit');
        $submit->setLabel('Send');

        $this->addElements(array(
            $givenName, $familyName, $submit
        ));

        return $this;
    }
}
?>
